﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using HF.BizWinner.DB.Linq;

public partial class Register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void BtnRegister_Click(object sender, EventArgs e)
    {
        try
        {
            User u = new User();
            u.UserName = this.UserName.Text;
            u.Password = this.Password.Text;
            u.Email = this.MailBox.Text;
            u.RealName = this.Name.Text;
            u.CompanyName = this.Company.Text;
            u.Department = this.Department.Text;
            u.Position = this.Position.Text;
            u.Phone = this.Phon.Text;
            u.RegistIp = Request.UserHostAddress;
            BizWinnerDataContext dbCx = new BizWinnerDataContext();
            dbCx.User.InsertOnSubmit(u);
            dbCx.SubmitChanges();
            Response.Redirect("~/Default.aspx");
        }
        catch {}
    }
}
